package com.zhong.gang.pda.db.loction;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;
import com.zhong.gang.pda.ui.action.HuoBean;
@DatabaseTable(tableName = "LoctionMessage")
public class LoctionMessage {
    @DatabaseField(generatedId = true)
    private int _id;
    @DatabaseField(columnName = "id")
    private int id;
    @DatabaseField(columnName = "str")
    private String str;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setData(HuoBean huoBean) {
        if (str == null)
            this.str = "";
        this.str = new Gson().toJson(huoBean);
    }
    public HuoBean getHuoBean(){
        if (TextUtils.isEmpty(str))
            return new HuoBean();
        return new Gson().fromJson(str,HuoBean.class);
    }
}
